<?php $this->headLink()->appendStylesheet($this->js('css/jquery.treeview.css'));
$this->headScript()->appendFile($this->js('jquery.cookie.js'))
->appendFile($this->js('jquery.treeview.js'))
->appendFile($this->js('jquery.treeview.async.js'))
->appendFile($this->js('plugins/jquery.form.js'))
->appendFile($this->js('jquery-validate/jquery.validate.min.js'))
->appendFile($this->jqueryValidateMessage())
->captureStart()?>
$(document).ready(function(){
		$("#items").treeview({
			url: "<?php echo $this->route('list')?>",
			collapsed: true,
			unique: true,
			persist: "cookie",
			animated: "fast"
		})

		$("#items li span").live('click',function(){
			var id = $(this).parent('li').attr('id');
			if (id) {
				$.get('<?php echo $this->route('set')?>',{sn:id},function(data){
					$("#set").html(data).show();
				});

			}
		});



	});
<?php $this->headScript()->captureEnd()?>
<style>
<!--
#main , #set {float:left;margin:5px}
#set{width:500px;border:thin #ccc solid; padding:3px;background:#ffe}
#listSet table {background:#ccc;width:100%}
#listSet  th {background:#ccc;text-align:center;}
#listSet  td {text-align:center;}
#main li {cursor:pointer;}
.error{border:thin solid #f00;}
-->
</style>


<div id="main">

	<h4><?php echo $this->translate('system items configuration')?></h4>

	<ul id="items">
	</ul>
</div>

<div id="set" style="display:none;">
</div>



<div style="clear:both"></div>